package example.jdbc;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import wangjg.dbfx.JdbcSession;
import wangjg.dbfx.SessionFactory;

import com.scaffold.catalog.entity.Catalog;

@Repository
public class CatalogDAO{

	@Autowired
	private SessionFactory sessionFactory;
	
	public List<Catalog> findByParentId(Long parentId) {
		JdbcSession session = sessionFactory.getCurrentSession();
		List list = session.query(Catalog.class, "select * from Catalog");
		return list;
	}

}
